for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
// EmptyStackException.js
"use strict";
// :: DEPENDENCIES
// load native dependencies
const path = require("path");
// load local dependencies
const RuntimeException = require(path.join(__dirname, "RuntimeException.js"));
// :: BASIC SETUP
/**
* Thrown by methods in the Stack class to indicate that the stack is empty.
* @param {String} message - The message describing the <tt>EmptyStackException</tt>.
* @param {Number} code - The unique code that identifies the cause of the <tt>EmptyStackException</tt>.
* @augments RuntimeException
* @constructor
* @see https://docs.oracle.com/javase/8/docs/api/java/util/EmptyStackException.html
*/
const EmptyStackException = function (message, code) {
RuntimeException.call(this, null, message, code);
};
// :: INHERITANCE
// set the RuntimeException 'class' as the parent in the prototype chain
EmptyStackException.prototype = Object.create(RuntimeException.prototype);
EmptyStackException.prototype.constructor = RuntimeException;
// :: PROTOTYPE
* The name used to identify an <tt>EmptyStackException</tt>.
* @type {String}
* @default
EmptyStackException.prototype.name = "EmptyStackException";
// :: EXPORT
// export the EmptyStackException 'class'
module.exports = EmptyStackException;